<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>我的预约 - 五四宪法历史资料陈列室</title>
    <link rel="stylesheet" href="/static/pc/css/style.css">
    <script src="/static/pc/js/jquery.min.js"></script>
    <script src="/static/pc/css/bootstrap.min.css"></script>
</head>
<body>
<div class="head">
    <img src="/static/pc/img/head.jpg" alt="">
</div>
<div class="main">
    <div class="title_img"><img src="/static/pc/img/hd.png" alt=""></div>
    <div class="top_right">
        <a href="my_order?mobile={$Think.session.mobile}" class="orderlist another canshu1">展馆预约记录</a>
        <a href="javascript:;" class="orderlist canshu1 last">活动预约记录</a>
        {if condition="$Think.session.mobile"}  <span class="login_status">{$Think.session.mobile} </span><a class="login_status" href="home_tuichu" onclick="$('.layer2').show()"> 退出</a>{/if}
        <a class="back" href="/">返回首页</a>
    </div>
    <div class="clear"></div>
    <div class="order_list">
        <p></p>
        <table rules=none>
            <thead>
            <tr>
                <th>预约状态</th>
                <th>活动标题</th>
                <th>参与时间</th>
                <th>参与人数</th>
                <th>预约人姓名</th>
                <th>联系人电话</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {foreach $list as $k=>$v}
                <tr>
                    <td>{if condition ="$v.status == 1"}预约中{else/}已取消{/if}</td>
                    <td>{$v.active.title}</td>
                    <td>日期:{$v.active.day}<br>时段:{$v.active.timer}</td>
                    <td>{$v.views}</td>
                    <td>{$v.name}</td>
                    <td>{$v.mobile}</td>
                    <td>
                        {if condition = "$v.status == 1 "}
                        <a href="active_xq?id={$v.id}"><button class="orange">查看详情</button></a>
                        <button class="gray" onclick="active_del('{$v.id}')">取消</button>
                        {/if}
                        {if condition = "$v.status == 0 "}
                        <button class="gray1">已取消</button>
                        {/if}
                    </td>
                </tr>
            {/foreach}
            </tbody>
        </table>
    </div>
</div>
<script src="/static/css/bootstrap.min.css"></script>
<script>
    function active_del(id){
        $.ajax({
            type: 'POST',
            url: 'active_del',
            data: {"id":id},
            dataType:'json',
            success: function (result){
                if(result == 1){
                    // alert("取消成功");
                    layer.alert('取消成功',{
                        icon: 1,
                        title:false,
                        time:5000

                    })
                    window.location.reload();
                }
            },
        });
    }

    function active_xq(id){
        $.ajax({
            type: 'post',
            url: 'active_xq',
            data: {"id":id},
            dataType:'json',
            success: function (result){
                //console.log(result);
            },
        });
    }

</script>
</body>
</html>